- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 19.2k
 
Deprecate series.nonzero (GH18262) #24048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           Hello @makbigc! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on January 05, 2019 at 21:23 Hours UTC | 
    
| 
           this would need a test. Also you would need to remove any uses of this from the test code itself (otherwise it would show a warning)  | 
    
| -------- | ||
| numpy.nonzero | ||
| """ | ||
| msg = ("Series.nonzero() is deprecated " | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you show what it is replaced by here
| 
           can you merge master and update  | 
    
ec4a003    to
    e06a908      
    Compare
  
    
          Codecov Report
 @@             Coverage Diff             @@
##           master   #24048       +/-   ##
===========================================
- Coverage   92.31%   42.46%   -49.85%     
===========================================
  Files         166      161        -5     
  Lines       52412    51559      -853     
===========================================
- Hits        48382    21894    -26488     
- Misses       4030    29665    +25635
 
 Continue to review full report at Codecov. 
  | 
    
          Codecov Report
 @@            Coverage Diff             @@
##           master   #24048      +/-   ##
==========================================
+ Coverage   92.37%   92.37%   +<.01%     
==========================================
  Files         166      166              
  Lines       52377    52379       +2     
==========================================
+ Hits        48385    48387       +2     
  Misses       3992     3992
 
 Continue to review full report at Codecov. 
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any warnings issued by the test suite? need to change any internal uses of this
| 
           also remove this from api.rst if it exists  | 
    
| 
           the original docs/api.rst got added back, can you remove  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are NO warnings from the test suite?
        
          
                pandas/core/series.py
              
                Outdated
          
        
      | """ | ||
| msg = ("Series.nonzero() is deprecated " | ||
| "and will be removed in a future version." | ||
| "Use np.nonzero(Series.values) instead") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a good replacement, instead recommend
np.nonzero(Series.to_numpy())(or Series.to_numpy().non_zero())
| 
           No warning is raised due to deprecation of Series.nonzero, running the test suite in my own machine.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine, but need to remove doc/source/api.rst which you seem to have added back
| 
           thank @makbigc  | 
    
Revert pandas-dev#24048 change that caused bug.
Series.nonzero() was deprecated in pandas-dev/pandas#24048. Using the latest pandas breaks fbprophet. We can replace .nonzero() use with .to_numpy().nonzero().
Series.nonzero() was deprecated in pandas-dev/pandas#24048. Using the latest pandas breaks fbprophet. We can replace .nonzero() use with .to_numpy().nonzero().
xref #18262
git diff upstream/master -u -- "*.py" | flake8 --diff